Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Minor range sync tweaks #3806

Merged
merged 4 commits into from
Mar 1, 2022
Merged

Minor range sync tweaks #3806

merged 4 commits into from
Mar 1, 2022

Conversation

dapplion
Copy link
Contributor

Motivation

Some minor tweaks while debugging #3804

Description

@dapplion dapplion changed the title Dapplion/review range sync Minor range sync tweaks Feb 28, 2022
@github-actions
Copy link
Contributor

github-actions bot commented Feb 28, 2022

Performance Report

✔️ no performance regression detected

Full benchmark results
Benchmark suite Current: 44f9731 Previous: e175d12 Ratio
BeaconState.hashTreeRoot - No change 703.00 ns/op 553.00 ns/op 1.27
BeaconState.hashTreeRoot - 1 full validator 101.51 us/op 82.554 us/op 1.23
BeaconState.hashTreeRoot - 32 full validator 1.5145 ms/op 1.2131 ms/op 1.25
BeaconState.hashTreeRoot - 512 full validator 20.512 ms/op 16.691 ms/op 1.23
BeaconState.hashTreeRoot - 1 validator.effectiveBalance 114.11 us/op 90.064 us/op 1.27
BeaconState.hashTreeRoot - 32 validator.effectiveBalance 1.9410 ms/op 1.4500 ms/op 1.34
BeaconState.hashTreeRoot - 512 validator.effectiveBalance 22.441 ms/op 19.918 ms/op 1.13
BeaconState.hashTreeRoot - 1 balances 77.927 us/op 51.912 us/op 1.50
BeaconState.hashTreeRoot - 32 balances 642.66 us/op 507.71 us/op 1.27
BeaconState.hashTreeRoot - 512 balances 6.4090 ms/op 5.3364 ms/op 1.20
BeaconState.hashTreeRoot - 250000 balances 117.39 ms/op 112.51 ms/op 1.04
processSlot - 1 slots 59.530 us/op 44.351 us/op 1.34
processSlot - 32 slots 3.0787 ms/op 2.2105 ms/op 1.39
getCommitteeAssignments - req 1 vs - 250000 vc 5.4861 ms/op 5.2359 ms/op 1.05
getCommitteeAssignments - req 100 vs - 250000 vc 7.6984 ms/op 7.3022 ms/op 1.05
getCommitteeAssignments - req 1000 vs - 250000 vc 9.0556 ms/op 7.7714 ms/op 1.17
computeProposers - vc 250000 26.762 ms/op 22.345 ms/op 1.20
computeEpochShuffling - vc 250000 204.04 ms/op 192.97 ms/op 1.06
getNextSyncCommittee - vc 250000 426.06 ms/op 361.95 ms/op 1.18
altair processAttestation - 250000 vs - 7PWei normalcase 34.341 ms/op 34.540 ms/op 0.99
altair processAttestation - 250000 vs - 7PWei worstcase 39.760 ms/op 39.690 ms/op 1.00
altair processAttestation - setStatus - 1/6 committees join 14.700 ms/op 15.105 ms/op 0.97
altair processAttestation - setStatus - 1/3 committees join 30.901 ms/op 31.256 ms/op 0.99
altair processAttestation - setStatus - 1/2 committees join 43.404 ms/op 39.568 ms/op 1.10
altair processAttestation - setStatus - 2/3 committees join 57.456 ms/op 55.419 ms/op 1.04
altair processAttestation - setStatus - 4/5 committees join 69.391 ms/op 67.376 ms/op 1.03
altair processAttestation - setStatus - 100% committees join 90.338 ms/op 81.631 ms/op 1.11
altair processAttestation - updateEpochParticipants - 1/6 committees join 15.580 ms/op 14.193 ms/op 1.10
altair processAttestation - updateEpochParticipants - 1/3 committees join 31.656 ms/op 29.042 ms/op 1.09
altair processAttestation - updateEpochParticipants - 1/2 committees join 23.049 ms/op 23.136 ms/op 1.00
altair processAttestation - updateEpochParticipants - 2/3 committees join 28.701 ms/op 24.466 ms/op 1.17
altair processAttestation - updateEpochParticipants - 4/5 committees join 27.216 ms/op 29.658 ms/op 0.92
altair processAttestation - updateEpochParticipants - 100% committees join 29.566 ms/op 26.625 ms/op 1.11
altair processAttestation - updateAllStatus 23.211 ms/op 20.359 ms/op 1.14
altair processBlock - 250000 vs - 7PWei normalcase 40.526 ms/op 37.486 ms/op 1.08
altair processBlock - 250000 vs - 7PWei worstcase 128.70 ms/op 110.49 ms/op 1.16
altair processEpoch - mainnet_e81889 928.43 ms/op 833.12 ms/op 1.11
mainnet_e81889 - altair beforeProcessEpoch 359.91 ms/op 368.02 ms/op 0.98
mainnet_e81889 - altair processJustificationAndFinalization 129.88 us/op 51.549 us/op 2.52
mainnet_e81889 - altair processInactivityUpdates 20.923 ms/op 19.538 ms/op 1.07
mainnet_e81889 - altair processRewardsAndPenalties 141.52 ms/op 101.12 ms/op 1.40
mainnet_e81889 - altair processRegistryUpdates 24.328 us/op 5.4250 us/op 4.48
mainnet_e81889 - altair processSlashings 6.4450 us/op 1.2120 us/op 5.32
mainnet_e81889 - altair processEth1DataReset 6.7610 us/op 1.0880 us/op 6.21
mainnet_e81889 - altair processEffectiveBalanceUpdates 6.7655 ms/op 6.3110 ms/op 1.07
mainnet_e81889 - altair processSlashingsReset 37.643 us/op 8.7550 us/op 4.30
mainnet_e81889 - altair processRandaoMixesReset 47.769 us/op 12.285 us/op 3.89
mainnet_e81889 - altair processHistoricalRootsUpdate 8.8370 us/op 1.3200 us/op 6.69
mainnet_e81889 - altair processParticipationFlagUpdates 91.941 ms/op 73.965 ms/op 1.24
mainnet_e81889 - altair processSyncCommitteeUpdates 5.6410 us/op 1.1560 us/op 4.88
mainnet_e81889 - altair afterProcessEpoch 256.82 ms/op 225.42 ms/op 1.14
altair processInactivityUpdates - 250000 normalcase 87.585 ms/op 82.583 ms/op 1.06
altair processInactivityUpdates - 250000 worstcase 82.369 ms/op 86.777 ms/op 0.95
altair processParticipationFlagUpdates - 250000 anycase 54.093 ms/op 71.187 ms/op 0.76
altair processRewardsAndPenalties - 250000 normalcase 93.382 ms/op 95.809 ms/op 0.97
altair processRewardsAndPenalties - 250000 worstcase 92.741 ms/op 113.74 ms/op 0.82
altair processSyncCommitteeUpdates - 250000 440.42 ms/op 362.92 ms/op 1.21
Tree 40 250000 create 931.55 ms/op 843.55 ms/op 1.10
Tree 40 250000 get(125000) 354.82 ns/op 330.46 ns/op 1.07
Tree 40 250000 set(125000) 2.5876 us/op 2.6735 us/op 0.97
Tree 40 250000 toArray() 49.732 ms/op 45.995 ms/op 1.08
Tree 40 250000 iterate all - toArray() + loop 50.285 ms/op 49.606 ms/op 1.01
Tree 40 250000 iterate all - get(i) 132.75 ms/op 124.42 ms/op 1.07
MutableVector 250000 create 23.280 ms/op 21.691 ms/op 1.07
MutableVector 250000 get(125000) 15.946 ns/op 12.473 ns/op 1.28
MutableVector 250000 set(125000) 802.62 ns/op 631.00 ns/op 1.27
MutableVector 250000 toArray() 9.8559 ms/op 9.2827 ms/op 1.06
MutableVector 250000 iterate all - toArray() + loop 10.124 ms/op 9.3777 ms/op 1.08
MutableVector 250000 iterate all - get(i) 3.8283 ms/op 3.7780 ms/op 1.01
Array 250000 create 7.9982 ms/op 6.0659 ms/op 1.32
Array 250000 clone - spread 2.1147 ms/op 2.2466 ms/op 0.94
Array 250000 get(125000) 1.1580 ns/op 1.1140 ns/op 1.04
Array 250000 set(125000) 1.1550 ns/op 1.0720 ns/op 1.08
Array 250000 iterate all - loop 148.68 us/op 168.04 us/op 0.88
effectiveBalanceIncrements clone Uint8Array 300000 1.3947 ms/op 81.906 us/op 17.03
effectiveBalanceIncrements clone MutableVector 300000 695.00 ns/op 676.00 ns/op 1.03
effectiveBalanceIncrements rw all Uint8Array 300000 198.58 us/op 302.14 us/op 0.66
effectiveBalanceIncrements rw all MutableVector 300000 217.40 ms/op 219.99 ms/op 0.99
aggregationBits - 2048 els - readonlyValues 227.39 us/op 194.61 us/op 1.17
aggregationBits - 2048 els - zipIndexesInBitList 36.864 us/op 45.064 us/op 0.82
regular array get 100000 times 56.465 us/op 67.463 us/op 0.84
wrappedArray get 100000 times 56.016 us/op 67.543 us/op 0.83
arrayWithProxy get 100000 times 43.180 ms/op 29.494 ms/op 1.46
ssz.Root.equals 1.2990 us/op 1.1530 us/op 1.13
ssz.Root.equals with valueOf() 1.5760 us/op 1.4210 us/op 1.11
byteArrayEquals with valueOf() 1.6850 us/op 1.3660 us/op 1.23
phase0 processBlock - 250000 vs - 7PWei normalcase 10.952 ms/op 8.2626 ms/op 1.33
phase0 processBlock - 250000 vs - 7PWei worstcase 100.27 ms/op 76.830 ms/op 1.31
phase0 afterProcessEpoch - 250000 vs - 7PWei 228.70 ms/op 208.29 ms/op 1.10
phase0 beforeProcessEpoch - 250000 vs - 7PWei 717.85 ms/op 588.65 ms/op 1.22
phase0 processEpoch - mainnet_e58758 953.96 ms/op 811.85 ms/op 1.18
mainnet_e58758 - phase0 beforeProcessEpoch 566.91 ms/op 460.44 ms/op 1.23
mainnet_e58758 - phase0 processJustificationAndFinalization 129.02 us/op 51.099 us/op 2.52
mainnet_e58758 - phase0 processRewardsAndPenalties 112.65 ms/op 120.97 ms/op 0.93
mainnet_e58758 - phase0 processRegistryUpdates 95.142 us/op 36.221 us/op 2.63
mainnet_e58758 - phase0 processSlashings 6.3530 us/op 1.1980 us/op 5.30
mainnet_e58758 - phase0 processEth1DataReset 6.3240 us/op 1.0630 us/op 5.95
mainnet_e58758 - phase0 processEffectiveBalanceUpdates 6.0535 ms/op 5.1775 ms/op 1.17
mainnet_e58758 - phase0 processSlashingsReset 33.742 us/op 7.7230 us/op 4.37
mainnet_e58758 - phase0 processRandaoMixesReset 45.113 us/op 12.139 us/op 3.72
mainnet_e58758 - phase0 processHistoricalRootsUpdate 9.0770 us/op 1.3830 us/op 6.56
mainnet_e58758 - phase0 processParticipationRecordUpdates 31.174 us/op 8.3580 us/op 3.73
mainnet_e58758 - phase0 afterProcessEpoch 203.46 ms/op 183.11 ms/op 1.11
phase0 processEffectiveBalanceUpdates - 250000 normalcase 6.8221 ms/op 5.9665 ms/op 1.14
phase0 processEffectiveBalanceUpdates - 250000 worstcase 0.5 7.2397 ms/op 6.4143 ms/op 1.13
phase0 processRegistryUpdates - 250000 normalcase 90.136 us/op 36.259 us/op 2.49
phase0 processRegistryUpdates - 250000 badcase_full_deposits 4.1046 ms/op 3.1754 ms/op 1.29
phase0 processRegistryUpdates - 250000 worstcase 0.5 2.4208 s/op 1.8921 s/op 1.28
phase0 getAttestationDeltas - 250000 normalcase 15.378 ms/op 13.262 ms/op 1.16
phase0 getAttestationDeltas - 250000 worstcase 14.662 ms/op 13.338 ms/op 1.10
phase0 processSlashings - 250000 worstcase 43.151 ms/op 44.579 ms/op 0.97
shuffle list - 16384 els 13.891 ms/op 13.178 ms/op 1.05
shuffle list - 250000 els 202.26 ms/op 188.58 ms/op 1.07
getEffectiveBalanceIncrementsZeroInactive - 250000 vs - 7PWei 758.33 us/op 430.95 us/op 1.76
pass gossip attestations to forkchoice per slot 20.574 ms/op 15.816 ms/op 1.30
computeDeltas 4.0608 ms/op 3.5998 ms/op 1.13
computeProposerBoostScoreFromBalances 488.51 us/op 503.21 us/op 0.97
getPubkeys - index2pubkey - req 1000 vs - 250000 vc 2.5396 ms/op 2.2406 ms/op 1.13
getPubkeys - validatorsArr - req 1000 vs - 250000 vc 803.02 us/op 795.27 us/op 1.01
BLS verify - blst-native 2.2835 ms/op 1.8550 ms/op 1.23
BLS verifyMultipleSignatures 3 - blst-native 4.8483 ms/op 3.8174 ms/op 1.27
BLS verifyMultipleSignatures 8 - blst-native 9.6273 ms/op 8.2331 ms/op 1.17
BLS verifyMultipleSignatures 32 - blst-native 35.956 ms/op 29.872 ms/op 1.20
BLS aggregatePubkeys 32 - blst-native 45.957 us/op 40.080 us/op 1.15
BLS aggregatePubkeys 128 - blst-native 189.56 us/op 154.12 us/op 1.23
getAttestationsForBlock 68.831 ms/op 65.386 ms/op 1.05
CheckpointStateCache - add get delete 23.778 us/op 19.323 us/op 1.23
validate gossip signedAggregateAndProof - struct 5.3727 ms/op 4.4705 ms/op 1.20
validate gossip signedAggregateAndProof - treeBacked 5.3199 ms/op 4.4199 ms/op 1.20
validate gossip attestation - struct 2.5559 ms/op 2.0990 ms/op 1.22
validate gossip attestation - treeBacked 2.5749 ms/op 2.1072 ms/op 1.22
pickEth1Vote - no votes 9.8173 ms/op 10.525 ms/op 0.93
pickEth1Vote - max votes 62.917 ms/op 54.239 ms/op 1.16
pickEth1Vote - Eth1Data hashTreeRoot value x2048 32.372 ms/op 25.238 ms/op 1.28
pickEth1Vote - Eth1Data hashTreeRoot tree x2048 11.464 ms/op 9.7775 ms/op 1.17
pickEth1Vote - Eth1Data fastSerialize value x2048 5.7549 ms/op 5.8127 ms/op 0.99
pickEth1Vote - Eth1Data fastSerialize tree x2048 28.372 ms/op 24.814 ms/op 1.14
bytes32 toHexString 2.0420 us/op 1.8640 us/op 1.10
bytes32 Buffer.toString(hex) 894.00 ns/op 695.00 ns/op 1.29
bytes32 Buffer.toString(hex) from Uint8Array 1.2690 us/op 940.00 ns/op 1.35
bytes32 Buffer.toString(hex) + 0x 914.00 ns/op 697.00 ns/op 1.31
Object access 1 prop 0.46900 ns/op 0.35100 ns/op 1.34
Map access 1 prop 0.40900 ns/op 0.30500 ns/op 1.34
Object get x1000 18.176 ns/op 18.063 ns/op 1.01
Map get x1000 1.0550 ns/op 1.0910 ns/op 0.97
Object set x1000 116.28 ns/op 110.49 ns/op 1.05
Map set x1000 74.942 ns/op 69.805 ns/op 1.07
Return object 10000 times 0.41120 ns/op 0.37400 ns/op 1.10
Throw Error 10000 times 6.9843 us/op 5.8056 us/op 1.20
enrSubnets - fastDeserialize 64 bits 1.6120 us/op 1.2830 us/op 1.26
enrSubnets - ssz BitVector 64 bits 20.712 us/op 16.992 us/op 1.22
enrSubnets - fastDeserialize 4 bits 613.00 ns/op 462.00 ns/op 1.33
enrSubnets - ssz BitVector 4 bits 3.8370 us/op 2.9980 us/op 1.28
RateTracker 1000000 limit, 1 obj count per request 241.56 ns/op 183.71 ns/op 1.31
RateTracker 1000000 limit, 2 obj count per request 178.77 ns/op 138.15 ns/op 1.29
RateTracker 1000000 limit, 4 obj count per request 147.83 ns/op 115.41 ns/op 1.28
RateTracker 1000000 limit, 8 obj count per request 136.23 ns/op 104.47 ns/op 1.30
RateTracker with prune 5.1800 us/op 4.4960 us/op 1.15
array of 16000 items push then shift 5.4965 us/op 3.1588 us/op 1.74
LinkedList of 16000 items push then shift 20.301 ns/op 19.271 ns/op 1.05
array of 16000 items push then pop 257.45 ns/op 210.88 ns/op 1.22
LinkedList of 16000 items push then pop 21.706 ns/op 16.711 ns/op 1.30
array of 24000 items push then shift 8.6622 us/op 4.5752 us/op 1.89
LinkedList of 24000 items push then shift 19.390 ns/op 23.746 ns/op 0.82
array of 24000 items push then pop 229.05 ns/op 207.63 ns/op 1.10
LinkedList of 24000 items push then pop 17.444 ns/op 19.462 ns/op 0.90

by benchmarkbot/action

@codecov
Copy link

codecov bot commented Feb 28, 2022

Codecov Report

Merging #3806 (44f9731) into master (62b2092) will not change coverage.
The diff coverage is n/a.

❗ Current head 44f9731 differs from pull request most recent head 75a25b9. Consider uploading reports for the commit 75a25b9 to get more accurate results

@@           Coverage Diff           @@
##           master    #3806   +/-   ##
=======================================
  Coverage   36.82%   36.82%           
=======================================
  Files         324      324           
  Lines        8870     8870           
  Branches     1385     1385           
=======================================
  Hits         3266     3266           
  Misses       5461     5461           
  Partials      143      143           

wemeetagain
wemeetagain previously approved these changes Feb 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants